翻訳と辞書
Words near each other
・ Object 478
・ Object 775
・ Object 785
・ Object 907
・ Object access method
・ Object Action Complex
・ Object animation
・ Object binding
・ Object browser
・ Object categorization from image search
・ Object code
・ Object code optimizer
・ Object composition
・ Object conservation
・ Object Constraint Language
Object copying
・ Object Data Management Group
・ Object Data Manager
・ Object database
・ Object Definition Language
・ Object Description Language
・ Object Design, Incorporated
・ Object Desktop
・ Object detection
・ Object diagram
・ OBject EXchange
・ Object Exchange Model
・ Object file
・ Object graph
・ Object hyperlinking


Dictionary Lists
翻訳と辞書 辞書検索 [ 開発暫定版 ]
スポンサード リンク

Object copying : ウィキペディア英語版
Object copying
In object-oriented programming, object copying is creating a copy of an existing object, a unit of data in object-oriented programming. The resulting object is called an object copy or simply copy of the original object. Copying is basic but has subtleties and can have significant overhead. There are several ways to copy an object, most commonly by a copy constructor or cloning. Copying is primarily done so the copy can be modified or moved, or the current value preserved; if these are not necessary, a reference to the original data is sufficient and more efficient, as it does not require copying.
Objects in general store composite data; while in simple cases copying can be done by allocating a new, uninitialized object and copying all fields (attributes) from the original object, in more complex cases this does not result in desired behavior.
== Methods of copying ==
The design goal of most objects is to give the resemblance of being made out of one monolithic block even though most are not. As objects are made up of several different parts, copying becomes nontrivial. Several strategies exist to attack this problem.
Consider an object A, which contains fields xi (more concretely, consider if A is a string and xi is an array of its characters). There are different strategies for making a copy of A, referred to as "shallow copy" and "deep copy". Many languages allow generic copying by one or either strategy, defining either a single "copy" operation or separate "shallow copy" and "deep copy" operations. Note that even shallower is to use a reference to the existing object A, in which case there is not even a new object, just a new reference.
The terminology of "shallow copy" and "deep copy" dates to Smalltalk-80. The same distinction holds for comparing objects for equality: most basically there is a difference between identity (same object) and equality (same value), corresponding to shallow equality and (1 level) deep equality of two object references, but then further whether equality means comparing only the fields of the object in question or dereferencing some or all fields and comparing their values in turn (e.g., are two linked lists equal if they have the same nodes, or if they have same values?).

抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)
ウィキペディアで「Object copying」の詳細全文を読む



スポンサード リンク
翻訳と辞書 : 翻訳のためのインターネットリソース

Copyright(C) kotoba.ne.jp 1997-2016. All Rights Reserved.